﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Web7.Ioc;
using Web7.Domain;

namespace Web7.Core.Security
{
    public interface IAuthorizationService : IDependency
    {
        /// <summary>
        /// 判断用户权限
        /// </summary>
        /// <param name="permission"></param>
        /// <param name="user"></param>
        /// <param name="content"></param>
        void CheckAccess<T>(Permission permission, IUser user, T content);

        /// <summary>
        /// 
        /// </summary>
        /// <param name="permission"></param>
        /// <param name="user"></param>
        /// <param name="content"></param>
        void CheckAccess<T>(string permission, IUser user, T content);

        /// <summary>
        /// 判断用户权限
        /// </summary>
        /// <param name="permission"></param>
        /// <param name="user"></param>
        /// <param name="content"></param>
        /// <returns></returns>
        bool TryCheckAccess<T>(Permission permission, IUser user, T content);

        /// <summary>
        /// 
        /// </summary>
        /// <param name="permission"></param>
        /// <param name="user"></param>
        /// <param name="content"></param>
        /// <returns></returns>
        bool TryCheckAccess<T>(string permission, IUser user, T content);
    }
}
